package com.film.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.film.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Sora
 * @date 2021/1/20 19:04
 */
@Repository
public interface UserMapper extends BaseMapper<User> {
    @Update("update user set name=#{name},password=#{password},phone=#{phone},sex=#{sex},birth=#{birth},sign=#{sign} where id=#{id}")
    boolean updateUser(User user);

    @Update("update user set avatar=#{path} where id=#{id}")
    Boolean updateAvatar(@Param("path") String path,@Param("id") Integer id);
    @Select("select *from user where username=#{username}")
    User userLogin(User user);
    @Select("select *from user where id=#{id}")
    User getUserInfo(Integer id);
    @Update("update user set username=#{username},name=#{name},avatar=#{avatar},birth=#{birth},sex=#{sex},sign=#{sign}")
    boolean saveUserInfo(User user);
}
